package com.user.application.query.service;

import com.user.application.query.assembler.UserDtoAssembler;
import com.user.application.query.dto.UserDto;
import com.user.infrastructure.repository.mapper.UserMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 大忽悠
 * @create 2022/9/28 18:32
 */
@Service
@RequiredArgsConstructor
public class UserQueryService {
    private final UserDtoAssembler userDtoAssembler;
    private final UserMapper userMapper;

    /**
     * 查询出所有用户信息
     * 1. 用户个人相关信息
     * 2. 签到信息
     * 3. ...
     */
    public List<UserDto> getAllUsers() {
       return userDtoAssembler.apply(userMapper.selectList(null));
    }
}
